package com.td.module.equipment.framework.core.dto;

import cn.hutool.core.annotation.Alias;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.time.LocalDateTime;

import static com.td.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
import static com.td.framework.common.util.date.DateUtils.TIME_ZONE_DEFAULT;

@Data
public class EquipmentInfoBaseDto {

    private String cmd;

    private Ext ext;

    private Integer isOnline;

    @Data
    public static class Ext {

        @Alias("StationID")
        private String stationID;

        @Alias("MonitorTime")
        @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
        private LocalDateTime monitorTime;

        private TerminalStatus terminalStatus;

        @Data
        public static class TerminalStatus {

            @Alias("VOLT")
            private String volt;

            @Alias("RSSI")
            private String rssi;

            @Alias("IMEI")
            private String imei;

            @Alias("ICCID")
            private String iccid;

            private String longitude;

            private String latitude;

            private String altitude;

            @Alias("Dotled")
            private Integer dotled;

            @Alias("Version")
            private String version;

            private Integer controlOp;

        }

    }

}
